package com.bdqn.rooms.util;

import com.alibaba.fastjson.JSONObject;
import com.bdqn.rooms.beans.*;
import org.springframework.stereotype.Component;

@Component
public class ObjectTrans {


    /**
     * JSON转换Euser
     * @param eusers
     * @return
     */
    public Euser euserTans(String eusers){
        Euser euser = JSONObject.parseObject(eusers,Euser.class);
        return euser;
    }

    /**
     * JSON转换Devroom
     * @param devrooms
     * @return
     */
    public Devroom devroomTans(String devrooms){
        Devroom devroom = JSONObject.parseObject(devrooms,Devroom.class);
        return devroom;
    }

    /**
     * JSON转换Rooms
     * @param roomss
     * @return
     */
    public Rooms roomsTans(String roomss){
        Rooms rooms = JSONObject.parseObject(roomss,Rooms.class);
        return rooms;
    }

    /**
     * JSON转换Ruser
     * @param rusers
     * @return
     */
    public Ruser ruserTans(String rusers){
        Ruser ruser = JSONObject.parseObject(rusers,Ruser.class);
        return ruser;
    }

    /**
     * JSON转换staffs
     * @param staffs
     * @return
     */
    public Staff staffTans(String staffs){
        Staff staff = JSONObject.parseObject(staffs,Staff.class);
        return staff;
    }

}
